Ram block allocator

ABSTRACT

Memory blocks are allocated for a microcontroller having one memory subsystem storing instruction information, and a separate memory subsystem storing data information. At design time, an address map is created implementing configurations of different ways of allocating instruction information and data information between memory blocks. At runtime, a configuration signal is received, and a particular memory block configuration for storing instruction information and data information is determined. An incoming instruction signal received from a dedicated microcontroller port, is communicated according to the configuration signal and the address map to a connection point (e.g., pin, fuse, register). Via that connection point, the instruction signal is routed to a memory block designated exclusively for instructions. Similarly, based upon the configuration signal and the address map, an incoming data signal (received from another dedicated microcontroller port), is routed via a connection point to a different memory block designated to store exclusively data information.

BACKGROUND

The present invention is directed to systems and methods for allocating blocks of Random Access Memory (RAM).

Microprocessors are increasingly called upon to perform complex functions in various computer architectures. Such microprocessors typically communicate with memory such as RAM in order to store data.

However, the RAM is also typically responsible for storing the computer code that provides instructions for the microprocessor to perform the various functions. This dual use of RAM for storing both data and instructions, can lead to inefficient consumption of RAM capacity, performance bottlenecks, and unwanted competition for memory resources.

SUMMARY

Embodiments relate to the allocation of RAM blocks for a microcontroller that has two separate memory subsystems. One memory subsystem stores instruction information; the other memory subsystem stores data information. Separate and distinct ports of the microcontroller are dedicated to handling the instruction information and the data information.

At design time, a designer creates an address map implementing various possible RAM block configurations. These configurations represent different ways of allocating instruction information and data information amongst the RAM blocks that are available.

At runtime, a configuration signal is received. Based upon that configuration signal, a particular RAM block configuration within the address map for storing instruction information and data information is determined.

An incoming instruction signal is received from the dedicated port of the microcontroller. Based upon the configuration signal and characteristics of the instruction signal, the address map is referenced to control connection point(s). Possible examples of such connection points can include, but are not limited to: pins, fuses, and registers

Via the configured connection point, the instruction signal is routed to an appropriate memory block that has been allocated to store exclusively instruction information. Similarly, based upon the configuration signal and the address map, an incoming data signal received from the dedicated port of the microcontroller is routed to an appropriate memory block allocated to store exclusively data information.

BRIEF DESCRIPTION OF THE DRAWINGS

The following diagrams are merely examples, which should not unduly limit the scope of the claims herein. One of ordinary skill in the art would recognize many other variations, modifications, and alternatives. It is also understood that the examples and embodiments described herein are for illustrative purposes only and that various modifications or changes in light thereof will be suggested to persons skilled in the art and are to be included within the spirit and purview of this process and scope of the appended claims.

FIG. 1 illustrates a simplified block diagram of a microprocessor in communication with an RAM block allocator according to an embodiment.

FIG. 2 is a simplified block diagram illustrating the operating environment of the allocation engine according to an embodiment.

FIG. 3 shows details of a RAM block allocator according to an embodiment.

FIG. 4 is a simplified flow chart showing a method according to an embodiment.

DESCRIPTION

The present invention is directed to systems and methods of allocating RAM. According to embodiments, methods and apparatuses of optimizing the access to RAM are provided.

FIG. 1 illustrates a simplified block diagram of a system 100 comprising a RAM block allocator 102 according to an embodiment, in communication with a microcontroller 104 comprising an instruction port 106 and a data port 108.

Here, the microcontroller includes separate infrastructure dedicated to processing either:

-   -   instructions for performing programming, or     -   data that is handled (stored, retrieved, modified) by that         programming.

The RAM block allocator and microcontroller are in communication via two separate channels:

-   -   instruction channel 110 in communication with respective         instruction ports 106 and 112; and     -   data channel 114 in communication with respective data ports 108         and 116.

The instruction channel and the data channel are indirectly coupled to at least two RAM blocks 118 (one block exclusively for instructions, one block exclusively for data) via respective RAM ports 120 of the (configurable) RAM block allocator.

Storage capacity of memory blocks in communication with the instruction channel may be combined logically to serve as instruction memory for the microcontroller. Capacity of memory blocks in communication with the data channel may be combined logically to serve as data memory.

Program instructions are typically stored in the instruction memory, while the data upon which it operates is commonly stored in the data memory. Generally, a memory block connected to the data channel cannot be used to store program instructions, and a memory block connected to the instruction channel cannot be used to store program data.

However some applications may require a larger amount of data, while other applications may involve a larger program size. Accordingly, it may be difficult for the designer to predict in advance, how much memory should be physically connected to the instruction versus data channels. Such an up-front decision by the designer, may undesirably later result in insufficient allocation of memory space of one type, while excess memory of the other type is left idle.

Accordingly, embodiments of the present invention allow configurable allocation of memory blocks as between instruction storage and data storage purposes, utilizing the RAM block allocator. Specifically, by referencing incoming configuration signal 122 sent via configuration line 124 and received at configuration port 126, an allocation engine 128 of the RAM block allocator may be configured at product deployment time to:

-   -   logically associate at least one of the available memory blocks         with the instruction channel; and     -   logically associate at least one of the remaining available         memory blocks to the data channel.

This configuration allows the designer to determine at deployment time, how much of the available memory is allocated for those two (data, instruction) purposes. This achieves flexibility together with high performance. In particular, the separate channels dedicated to instructions and data prevent bottlenecks that might arise if only a single channel were used for one memory access at a time.

FIG. 2 is a simplified block diagram illustrating the operating environment 200 of an allocation engine 202 according to an embodiment.

At runtime, configuration signal 204 is received. That configuration signal is transmitted by a designer and received at a configuration port of the RAM allocator. This configuration signal indicates the memory that is to be specifically allocated for storage of instruction information, and the memory that is to be specifically allocated for storage of data information.

The allocation engine processes the configuration signal, and in response generates 206 an address map 208 containing particular details for the routing of incoming instructions and data for storage in appropriate memory blocks allocated thereto. The address map is stored in a non-transitory storage medium 210 accessible to the allocator engine, for later reference.

An incoming instruction signal 250 is received by the allocation engine. That instruction signal may be a read or a write.

The allocation engine references 252 the address map 208, and in response issues a control signal 254 to a connection point 256. As a result, the instruction signal is routed through the connection point to memory block 258 that has been allocated to store exclusively instruction information.

Also at runtime, an incoming data signal 260 is received by the allocation engine. That instruction signal may again be a read or a write.

The allocation engine references 252 the address map 208, and in response issues a control signal 262 to a different connection point 264. As a result, the data signal is routed through the connection point to memory block 266 that has been allocated to store exclusively data information.

FIG. 3 illustrates a detailed view of a RAM allocator according to an embodiment. The instruction channel 350 and data channel 352 emanating from the ports of the microcontroller, are shown at the top side of the diagram.

Each of those (instruction, data) channels may typically comprise an Address bus 354, a Payload bus 356, and a Read/Write (R/W) signal 358. The R/W signal determines if a READ or WRITE access is to be performed.

As an example, only three RAM memory blocks 310-312 are shown in FIG. 3. Each memory block may have its own Address, Payload and R/W signals.

It is noted that each such memory block may be in the form of discrete memory chips that are soldered down onto a Printed Circuit Board (PCB) if the processor/memory complex is implemented on a system board. Alternatively, the memory block may be in the form of a memory “chiplet” or a RAM macro block, if the processor/memory complex is implemented as an integrated chip.

For ease of illustration, the combined Address, Payload, and R/W signals of the Instruction/Data Channels and the memory blocks are represented as broad busses 303 in the middle of FIG. 3.

Thick dark circles in the diagram represent configurable cross points 305. These cross points may be activated at deployment time in order to selectively couple each of the memory blocks appropriately to the instruction channel or the data channel.

For example, memory block 310 may be configured to be coupled to the instruction channel such that instruction accesses would be routed to memory block 310. Memory blocks 311 and 312 may be coupled to the data channel such that Data accesses are routed to those RAM blocks.

Configurable Address Map units 320, 321, 322 ensure that each memory block responds to (and only to) the addresses allocated to that block. For example, if memory block 311 has a capacity of 2Kwords, while 312 has a capacity of 1Kwords, the RAM block allocator may be configured to map the first 2Kword of its Data Memory to 311, and the next 1Kword to 312.

Subsequently, when a Data Channel READ access to word address “2176” is received, Address Map 321 may prevent memory block 311 from responding. Address Map 322 causes memory block 312 to return the content of its physical location “128” (since “2176”−“2048”=“128”).

This description of the configurable cross points 305, the address mapping units 320, 321, 322, and other elements shown in FIG. 3 represents one possible exemplary embodiment of the current invention. Examples of RAM block allocators may be implemented through one or more different mechanisms, including but not limited to:

-   -   configuration pins,     -   integrated programmable eFuses,     -   simple configuration registers, or     -   other relevant mechanisms.

For a sophisticated CPU, RAM block allocation could be implemented utilizing a simple micro-controller, micro-sequencer, or some Look Up Table (LUT), to provide flexibility in operation.

FIG. 4 is a simplified flow chart showing a method 400 according to an embodiment. During design time 401, a design input 402 is received from a designer.

At 403, an address map is created and stored. This address map includes a plurality of configurations for allocating instruction information and data information between available memory blocks.

During runtime 404, a configuration signal is received 406. This configuration signal determines a particular configuration for allocating instruction information and data information between available memory blocks.

At 407, an incoming instruction signal is received. At 408, the address map is referenced based upon the configuration signal and the characteristics of the instruction signal.

At 410, a connection point (e.g., pin, fuse, register) is controlled based upon the address map. At 412, the instruction signal is routed to an appropriate memory block that has been allocated to store exclusively instruction information.

At 414, an incoming data signal is received. Returning to 408, the address map is again referenced based upon the characteristics of the data signal.

Returning to 410, a different connection point is then controlled based upon the reference to the address map. At 416, the data signal is routed to a different memory block that has been allocated to store exclusively data information.

Embodiments of a RAM allocator according to embodiments, may offer one or more benefits. For example, embodiments afford a degree of flexibility for the designer to allocate at deployment time, the available memory to different purposes. This flexibility is allowed while still taking advantage of the performance that comes with having multiple independent (data, instruction) memory channels.

EXAMPLE

To illustrate the mapping for RAM block allocation according to an exemplary embodiment, consider the following simplified scenario. A system has three RAM blocks, of sizes 64KB, 32KB, and 16KB.

At design time, the following two possible exemplary configurations are included in the address map.

RAM #2 RAM #3 Total Instruction Total Data Config # RAM #1 (64 KB) (32 KB) (16 KB) Memory Memory A Allocate to INST Allocate Allocate 96 KB 16 KB to INST to DATA (64 + 32) B Allocate to INST Allocate Allocate 64 KB 48 KB to DATA to DATA (32 + 16)

Here, in Config #A, there is 96 KB worth of instruction memory. This instruction memory may be accessible via an address range such as 0x0-0000-0x0_5FFF (assuming each location is 32 bits wide).

In Config #A, there is also 16KB worth of data memory. This data memory may be accessed via another address range such as 0x8_0000-0x8 0FFF (again assuming 32 bits per location).

These particular addresses just mentioned above, are given as examples for purposes of illustration only. Accesses beyond those mapped ranges have undefined behavior, since that is all the memory that is available.

In this case, when an instruction access comes in from the dedicated microcontroller port via the instruction channel, the memory allocator needs to look at the given address, and route it to one of RAM blocks #1 or #2. For example, it may be such that 0x0_0000-0x0_03FFF (16 K×32 bits=64 KB) is mapped to RAM #1, and 0x0_4000-0x0_5FFF is mapped to RAM #2.

Let us say the incoming address is 0x0_4001. The allocator would cause the 2nd location of RAM #2 to be accessed by this request, the 1st location of RAM #2 being mapped to 0x0_4000.

Similarly, if Config #B were used, the allocator would perform a corresponding mapping for RAM #2 and RAM #3, upon a data access.

For implementation, the available memory may comprise more than the three RAM blocks described in the simple example above. And, various configurations implemented within the address map created at design time, can allow different combinations of those RAM blocks to be allocated.

Specifically, at design time the number of available memory blocks may be determined and fixed, and a number of supported configurations {A,B,C,D . . . } may be chosen by the designer. The designer may choose to support all possible combinations of allocating instruction/data between available memory blocks for full flexibility, or to support a subset thereof in order to reduce design complexity.

Those chosen configurations (and their corresponding mappings) are designed into the address map (e.g., 208 in FIG. 2), and made known to the software programmer.

At deployment time, the programmer chooses from amongst the supported configurations, by supplying the configuration signal (e.g., 204 in FIG. 2). No provision is made for the programmer to choose an unsupported configuration not already designed into the address map at design time.

While the above is a full description of the specific embodiments, various modifications, alternative constructions and equivalents may be used. Given the various applications and embodiments as described herein, the above description and illustrations should not be taken as limiting the scope of the present invention which is defined by the appended claims. 

1-20. (canceled)
 21. A network device comprising: first memory; a controller configured to generate memory access instructions indicating addresses of the first memory to access for transfers of data, the data not being memory access instructions; and allocator circuitry connected between the first memory and the controller and configured to perform an initial configuration of at least one memory configuration map to allocate selected addresses of the first memory for the memory access instructions and allocate other selected addresses of the first memory for the data, subsequent to performing the initial configuration, reconfigure the at least one memory configuration map to change allocations of addresses of the first memory for the memory access instructions and for the data, to change a proportion of the first memory allocated for the memory access instructions in relation to an amount of the first memory allocated for the data, and prior to and subsequent to reconfiguring the at least one memory configuration map and based on the at least one memory configuration map, route the memory access instructions and the data that is not memory access instructions between the controller and the first memory, store the memory access instructions only at selected addresses of the first memory allocated to memory access instructions, and store the data that is not instructions only at selected addresses of the first memory allocated to data.
 22. The network device of claim 21, wherein the allocator circuitry is configured to, prior to and subsequent to reconfiguring the at least one memory configuration map, transfer the data between the controller and the first memory based on the memory access instructions.
 23. The network device of claim 21, further comprising: a first port defining a first channel dedicated to transferring the memory access instructions; and a second port defining a second channel dedicated to transferring the data, wherein the allocator circuitry is configured to receive the memory access instructions from the controller via the first channel, and to transfer the data that is not memory access instructions between the controller and the allocator circuitry via the second channel.
 24. The network device of claim 21, wherein the allocator circuitry is configured to reconfigure the at least one memory configuration map to change a total number of addresses of the first memory allocated for the memory access instructions and a total number of the addresses of the first memory allocated for the data that is not memory access instructions.
 25. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; and the at least one memory configuration map maps addresses of the first memory to local addresses of the plurality of memory blocks.
 26. The network device of claim 21, wherein the allocator circuitry is configured to receive a first configuration signal from a configuration device and, based on the first configuration signal, to configure the at least one memory configuration map to allocate the selective addresses of the first memory for the memory access instructions and allocate the other selective addresses of the first memory for the data.
 27. The network device of claim 26, wherein the allocator circuitry is configured, based on the first configuration signal, to allocate a first amount of the first memory for storing the memory access instructions and to allocate a second amount of the first memory for storing the data that are not memory access instructions, the first configuration signal indicative of the first amount of the first memory and the second amount of the first memory.
 28. The network device of claim 26, wherein the allocator circuitry is configured to receive a second configuration signal from the configuration device and, based on the second configuration signal, to reconfigure the at least one memory configuration map to change the amount of the first memory allocated for the memory access instructions and to change the amount of the first memory allocated for the data that is not memory access instructions.
 29. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; the allocator circuitry is configured to configure a plurality of memory configuration maps, the plurality of memory configuration maps comprising the at least one memory configuration map; each of the plurality of memory configuration maps is allocated to a respective one of the plurality of memory blocks, a one-to-one relationship exists between the plurality of memory configuration maps and the plurality of memory blocks; and each of the plurality of memory configuration maps mapping corresponding ones of addresses of the first memory to local addresses within a respective one of the plurality of memory blocks.
 30. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; and the allocator circuitry is configured to selectively configure the at least one memory configuration map to allocate selected ones of the plurality of memory blocks for storing information provided in the memory access instructions and to allocate other selected ones the plurality of memory blocks for storing the data.
 31. The network device of claim , wherein the allocator circuitry is configured i) to receive a configuration signal from a configuration device separate from the network device and, ii) based on the configuration signal, to configure the at least one memory configuration map, the configuration signal indicating the selected ones the plurality of memory blocks allocated for storing the information provided in the memory access instructions and indicating the other selected ones of the plurality of memory blocks allocated for storing the data that is not memory access instructions.
 32. The network device of claim 21, wherein the allocator circuitry is configured i) to receive a configuration signal from a configuration device and, ii) based on the configuration signal, to configure the at least one memory configuration map to be in a configuration selected from among a plurality of possible configurations, each of the plurality of possible configurations allocating addresses of the first memory for the memory access instructions and the data differently, and each of the plurality of configurations allocating in different proportions a respective number of addresses of the first memory for memory access instructions and a respective number of addresses for the data that is not memory access instructions.
 33. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; and the allocator circuitry comprises a plurality of cross-points and is configured i) to receive a configuration signal from a configuration device separate from the network device, and ii) based on the configuration signal, to at least one of set or control the plurality of cross-points, the plurality of cross-points being configured to enable selective routing of the memory access instructions and the data that are not memory access instructions between the controller and the plurality of memory blocks.
 34. The network device of claim 33, wherein the plurality of cross-points comprise at least one of configuration pins, integrated programmable fuses, or configuration registers.
 35. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; and the allocator circuitry comprises a plurality of ports configured to transfer the memory access instructions and the data between the allocator circuitry and the plurality of memory blocks.
 36. The network device of claim 21, further comprising a single printed circuit board, wherein the first memory, the controller and the allocator circuitry are mounted on the single printed circuit board.
 37. The network device of claim 21, further comprising an integrated circuit comprising the first memory, the controller and the allocator circuitry.
 38. The network device of claim 37, wherein the integrated circuit comprises a second memory separate from the first memory, the second memory configured to store the at least one memory configuration map.
 39. The network device of claim 21, wherein: the first memory comprises a plurality of memory blocks; and the plurality of memory blocks are implemented as a plurality of integrated circuits such that each of the plurality of memory blocks is a distinct memory chip.
 40. A method of allocating and controlling access of first memory in a network device, the method comprising: generate memory access instructions at a controller indicating addresses of the first memory to access for transfers of data, the data not being memory access instructions; routing using allocator circuitry the memory access instructions and the data that is not memory access instructions between the controller and the first memory; performing using the allocator circuitry an initial configuration of at least one memory configuration map to allocate selected addresses of the first memory for the memory access instructions and allocate other selected addresses of the first memory for the data; subsequent to performing the initial configuration, reconfiguring the at least one memory configuration map to change allocations of addresses of the first memory for the memory access instructions and for the data, to change a proportion of the first memory allocated for the memory access instructions in relation to an amount of the first memory allocated for the data; and prior to and subsequent to reconfiguring the at least one memory configuration map and based on the at least one memory configuration map, routing the memory access instructions and the data that is not memory access instructions between the controller and the first memory, storing the memory access instructions only at selected addresses of the first memory allocated to memory access instructions, and storing the data that is not instructions only at selected addresses of the first memory allocated to data that is not instructions.
 41. The method of claim 40, further comprising, prior to and subsequent to reconfiguring the at least one memory configuration map, transferring the data between the controller and the first memory based on the memory access instructions.
 42. The method of claim 40, further comprising: receiving at the allocator circuitry the memory access instructions from the controller via a first channel, wherein the network device comprises a first port defining the first channel dedicated to transferring the memory access instructions and a second port defining a second channel dedicated to transferring the data; transferring the data between the controller and the allocator circuitry via the second channel based on the memory access instructions; and transferring the data between the allocator circuitry and the first memory based on the at least one memory configuration map.
 43. The method of claim 40, further comprising receiving a first configuration signal at the allocator circuitry from a configuration device separate from the network device and, based on the first configuration signal, configuring the at least one memory configuration map to allocate the selective addresses of the first memory for the memory access instructions and allocate the other selective addresses of the first memory for the data.
 44. The method of claim 43, further comprising, based on the first configuration signal, allocating a first amount of the first memory for storing the memory access instructions and to allocate a second amount of the first memory for storing the data, the first configuration signal indicative of the first amount of the first memory and the second amount of the first memory.
 45. The method of claim 43, further comprising receiving a second configuration signal from the configuration device and, based on the second configuration signal, reconfiguring the at least one memory configuration map to change the amount of the first memory allocated for the memory access instructions and to change the amount of the first memory allocated for the data. 